package com.dinzeer.sjapadder.sa;

import com.dinzeer.legendreliclib.lib.util.FastMakeEntityUtil;
import com.dinzeer.sjapadder.register.SjaEffect;
import mods.flammpfeil.slashblade.capability.concentrationrank.ConcentrationRankCapabilityProvider;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.LivingEntity;

public class ForLife {
    public static void doForLife(LivingEntity entityIn) {
        FastMakeEntityUtil.FastEffect(entityIn, MobEffects.REGENERATION, 3);
        FastMakeEntityUtil.FastEffect(entityIn, MobEffects.DAMAGE_RESISTANCE, 2);
        FastMakeEntityUtil.FastEffect(entityIn, MobEffects.DAMAGE_BOOST, 2);
        FastMakeEntityUtil.FastEffect(entityIn, MobEffects.HEALTH_BOOST, 2);
        if (entityIn != null) {
            entityIn.getCapability(ConcentrationRankCapabilityProvider.RANK_POINT)
                    .ifPresent((rank) ->rank.setRawRankPoint(rank.getMaxCapacity()));
        }
    }
    public static void doForLife2(LivingEntity entityIn) {
        FastMakeEntityUtil.FastEffect(entityIn, MobEffects.REGENERATION, 4);
        FastMakeEntityUtil.FastEffect(entityIn, MobEffects.DAMAGE_RESISTANCE, 3);
        FastMakeEntityUtil.FastEffect(entityIn, MobEffects.DAMAGE_BOOST, 3);
        FastMakeEntityUtil.FastEffect(entityIn, MobEffects.HEALTH_BOOST, 3);
        FastMakeEntityUtil.FastEffect(entityIn, SjaEffect.ForLife.get(), 1);
        FastMakeEntityUtil.FastEffect(entityIn, SjaEffect.ForLifeDrive.get(), 1);
        if (entityIn != null) {
            entityIn.getCapability(ConcentrationRankCapabilityProvider.RANK_POINT)
                    .ifPresent((rank) ->rank.setRawRankPoint(rank.getMaxCapacity()));
        }
    }
}
